package com.ming.transaction.common;

/**
 * 公共类型数据和接口
 * @author: Chenming
 * @date 2023/5/5 9:42
 */
public class Constant {
    //Redis
    public static final String Redis_User = "redis:token:";
    public static final Long Redis_User_TTL = 30L ;

    // 菜单
    public static final String MENU_LIST = "menu:list";
    // 角色
    public static final String ROLE_LIST = "role:list";
    // 分类表
    public static final String ROLE_CLASSIFY = "role:classify";
    // 图标
    public static final String ICONS_LIST = "icons:list";
    // ICONS 的存储时长
    public static final Long ICONS_LIST_TTL = 4L ;
    // 投诉
    public static final String COMPLAIN_USER = "complain:user:";
    public static final Long COMPLAIN_TTL = 1L ;
    // 用户个人信息
    public static final String USER_INFOMATION = "user:infomation:";

    // 图标类型
    public static final String TYPE_ICON = "icon";

    // 角色规范
    public static final String ROLE_ADMIN = "ROLE_ADMIN";
    public static final String ROLE_SUPERADMIN = "ROLE_SUPERADMIN";
    public static final String ROLE_USER = "ROLE_USER";

    // 用户默认头像
    public static final String USER_PICTURE = "http://localhost:9090/user/load/ccacc3baca6c41788c05fe33f282838f.jpg";


    // 盐值
    public static final String USER_SALT = "20053101jian";



    /**
     * 判断上传的是否图片
     *
     * @param type
     * @return
     */
    public static final boolean Filetype(String type) {
        String[] imgtype = {"jpg", "jepg", "png", "gif", "bmp", "tiff", "ai", "cdr", "eps"};
        for (int i = 0; i < imgtype.length; i++) {
            if (type.equals(imgtype[i])) {
                return true;
            }
        }
        return false;
    }
}
